<?php
$baseUrl = Yii::app()->request->baseUrl;
$notice = $this->getNotice();
$video = $this->getVideo();
$gallery = $this->getGallery();
$ads = $this->getAds();
$file = $this->getFile();
?>
<div class="post">
    <div class="title"><?php echo $notice->name ?></div>
    <ul class="nav notice">
        <?php
        $news = $this->findNews($notice->id);
        foreach ($news as $value) {
            echo '<li>' . CHtml::link('<i class="icon10-notice"></i>' . $value->name . '<br><p class="date-notice">' . date('d/m/Y', $value->create_time) . '</p>', array('/' . $value->detail . '-' . $value->id . '.html'), array('title' => $value->name)) . '</li>';
            ?>
        <?php } ?>
    </ul>
    <!-- VIDEO CLIP -->
    <div class="title">VIDEO CLIP</div>
    <?php
    if (!empty($video)) {
        ?>
        <object width="230" height="215"><param name="movie" value="//<?php echo $video[0]->link ?>"></param>
            <param name="allowFullScreen" value="true"></param>
            <param name="allowscriptaccess" value="always"></param>
            <embed src="//<?php echo $video[0]->link ?>" type="application/x-shockwave-flash" width="217" height="180" allowscriptaccess="always" allowfullscreen="true"></embed>
        </object>
    <?php } ?>
    <ul class="nav">
        <?php
        foreach ($video as $value) {
            echo '<li>' . CHtml::link('<i class="icon16-video"></i>' . $value->name, array('video-' . $value->id . '.html'), array('title' => $value->name)) . '</li>';
        }
        ?>
    </ul>

    <!-- GIÁ CẢ THỊ TRƯỜNG -->
    <div class="title"><?php echo $file[0]->name ?></div>
    <ul class="nav market">
        <?php
        $item = $this->getFileItem($file[0]->id);
        foreach ($item as $value) {
            echo '<li>'.CHtml::link('<i class="icon10-notice"></i>'.$value->name, array('/uploads/file/'.$value->file)).'</li>';
        }
        ?>
    </ul>

    <!-- THƯ VIỆN HÌNH ẢNH -->
    <div class="title">THƯ VIỆN HÌNH ẢNH</div>
    <?php
    echo CHtml::link(CHtml::image(Yii::app()->request->baseUrl . '/uploads/gallery/' . $gallery[0]->image, $gallery[0]->image, array('style' => 'width:217px')), array('thu-vien-hinh-anh.html'), array('title' => 'Hình ảnh'));
    ?>

    <div class="title">QUẢNG CÁO</div>
    <?php
    foreach ($ads as $ads) {
        echo '<a href="' . $ads->link . '" title="' . $ads->name . '">' . CHtml::image(Yii::app()->request->baseUrl . '/uploads/gallery/' . $ads->image, $ads->image, array('style' => 'width:212px; margin: 2px')) . '</a>';
    }
    ?>
</div>